home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0886.arc
/
GXCREF.LTR
< prev
next >
Wrap
Text File
|
1986-05-23
|
5KB
|
101 lines
Image Processing Section
Lab. Math. Biology, DCBD, NCI
National Institutes of Health
Bethesda, Md. 20892
May 23, 1986
Mr. Craig LaGrow, Editor
Computer Language
131 Townsend Street
San Francisco, CA 94107
Dear Craig,
I was glad to see the productivity tools issue. Since we are being
provided with denser memory and more power CPUs, the use of such
tools will become a necessity in constructing larger and more
sophisticated programs with the new hardware.
The CREF program by Reppert ("Cross-referencing in C and PASCAL", CL,
June 1986, 49-60) is one such essential tool. However, it needs a
minor modification to give it even greater utility in handling
large programs. Instead of operating on only one input file and
tracking line and page numbers within only that file, let the user
specify a SET of files and then track the triple (file/page#/line#)
for the CREF. Since large programs typically consist of a number of
modules this facility is invaluable in providing an "index" of the
set of modules - especially with several people working on the
different file.
I have written a similar cref program with this global extension
called GXCREF (in the SAIL language, "PSAIL: SAIL to C", CL Aug '85
pp39-44, using string processing instead of B-trees as Reppert did).
GXCREF stands for Global eXtended CREF. The "Global" concept meaning
multiple modules comes from the old DEC10/TOPS10 GLOB program which
generates a similar cref for a set of loader input files which are
generated by the macro assembler. The XCREF part comes from XCREF
which was a C cross reference utility similar to Reppert's by Wortman
and Sidebottom in their book 'The C Programming Tutor' by Wortman and
Sidebottom (R.J. Brady Co. 1984). A sample of the CREF output is
given below for several files:
{32} declsize PSGLBV.REQ/2/130 PSGLBV.SAI/2/144
PSDBUG.SAI/10/48 PSSYMT.SAI/7/49
PSCHEK.SAI/4/25 12/54 15/53 PSCVT.SAI/6/228
16/332 PSFSMA.SAI/2/684 5/118 8/52 94 161
184 PSFSMB.SAI/2/483 485 3/569 4/33
PSFSMD.SAI/2/99 198 699 710 3/193 198 301 548
PSLEX.SAI/5/50 57 PSPARSE.SAI/4/69 5/142
PSMAIN.SAI/2/97
{12} defaultvalue PSFSMB.SAI/3/6 42 166 569 PSPARSE.SAI/4/42
89 132 198 204 237 257
{15} delim PSFSMA.SAI/2/23 263 265 268 271 272 273 292
299 307 315
GXCREF has some other useful concepts including: builtin support for
several languages (ADA, C, FORTRAN, MODULA2, PASCAL, and SAIL) to
denote the keywords to omit as well as how comments and quoted
strings are to be handled - since tokens within comments or string
constants should be ignored; a count of the number of times each cref
token occurs - which can be used to report only those tokens within a
specified frequency range [minCount:maxCount]; specifying a list of
words in a file (like Reppert) which can be either omitted or used as
the basis for the cref; building an additional sorted list of all the
cref tokens found which can be combined with a switch to NOT generate
the CREF tables and listing.
The above additions let us use crefing for a number of other
"programming" jobs. For example, by specifying the occurence
frequency of any tokens to be reported as [1:1] we can find all
"clutter", i.e. variables defined but never used. Crefing can also be
useful for document processing. Find a set of keywords which you wish
to index and then use this set with a second cref to find where in
the document they actually occur. The algorithm would be as follows:
[1] Generate a wordlist of all words in the document with
the first CREF pass.
[2] Edit this list to include ONLY the words you wish to
index.
[3] Generate a CREF of the document using the edited wordlist
as the list of words to restrict the cref. This results in
pointers to the document of all entries to be manually
considered for you to index.
GXCREF was used extensivly in building PSAIL which could not have
been done without it. The GXCREF SAIL source file is on the CL BBS
for those who might be interested in the concepts of some of the
extensions. These could probably be added to Repperts program without
too much trouble.
Sincerely,
Peter F. Lemkin, Ph.D.